AM_CXXFLAGS = $(BOOST_CPPFLAGS) $(PROTOBUF_CXXFLAGS)
INCLUDES = -I$(top_srcdir)/src/ -I$(top_srcdir)/src/utils/ -I$(top_srcdir)/src/score/
METASOURCES = AUTO

lib_LTLIBRARIES = libcaptainbol-utils.la

noinst_DATA = captainbol-utils.vcproj 
pkgdata_SCRIPTS = runlcmsms.proto


if COND_PROTOBUF
PROTOBUF_PROTOS=runlcmsms.proto
PROTOBUF_CC=$(PROTOBUF_PROTOS:.proto=.pb.cc)
PROTOBUF_H=$(PROTOBUF_PROTOS:.proto=.pb.h)
BUILT_SOURCES = $(PROTOBUF_CC) $(PROTOBUF_H)

#$(srcdir)/runlcmsms.pb.cc $(srcdir)/runlcmsms.pb.h: $(srcdir)/runlcmsms.proto
#	$(PROTOC) -I$(srcdir) --cpp_out=$(srcdir) $<

java/src/com/genebio/bol/runlcmsms.java: $(srcdir)/runlcmsms.proto
	mkdir -p java/src
	$(PROTOC) -I$(srcdir) --java_out=java/src $<

java/captainbol.jar:java/src/com/genebio/bol/runlcmsms.java
	mkdir -p java/bin
	jar -C java/src -cf java/captainbol.jar com

.PHONY: jar
jar: java/captainbol.jar

%.pb.cc %.pb.h: %.proto
	$(PROTOC) -I$(srcdir) --cpp_out=$(srcdir) $<
	
#%_pb2.py: %.proto
#	$(PROTOC) -I$(srcdir) --python_out=$(srcdir) $<
endif

pkginclude_HEADERS = $(PROTOBUF_H) $(PROTOBUF_PROTOS) aminoacid.h \
	aminoacidinstancer.h aminoacidinstancerbasic.h chargemapper.h dbsequence.h \
	dbsequencedigestorfactory.h dbsequencefactory.h dbsequencefactoryfasta.h deltamass.h \
	deltamassbuilder.h deltamassda.h deltamassppm.h enzyme.h enzymetrypsin.h masscalculator.h \
	massindex.h massindexanchor.h modification.h modificationdictionary.h peak.h \
	peakintensity.h peakintensityrm.h peaklcms.h peaktheomsms.h peaktheomsmsfactory.h \
	peaktheomsmsfactorybasic.h peptide.h peptidefactory.h peptidefromsequence.h peptidemodifier.h \
	peptidemsmsfactory.h peptidepmffactory.h peptidespectrummatch.h peptidespectrummatchreader.h \
	psmnistmspreader.h runlcmsms.h runlcmsmsreader.h runlcmsmsreadermgf.h spectraalignment.h \
	spectraalignmentscoringmodel.h spectrum.h spectrumlcms.h spectrumlcmscollection.h spectrumlcmsms.h \
	spectrumlcmsmscollection.h spectrumlcmsmsmassindexanchor.h spectrumpeakintensityutilities.h \
	spectrumpeakref.h spectrumpeakrefdualptr.h spectrumpeakrefsimple.h
	
libcaptainbol_utils_la_SOURCES = $(PROTOBUF_CC) $(PROTOBUF_PROTOS) \
	aminoacid.cpp aminoacidinstancer.cpp aminoacidinstancerbasic.cpp chargemapper.cpp \
	dbsequence.cpp dbsequencedigestorfactory.cpp dbsequencefactory.cpp \
	dbsequencefactoryfasta.cpp deltamass.cpp deltamassbuilder.cpp deltamassda.cpp deltamassppm.cpp \
	enzyme.cpp enzymetrypsin.cpp masscalculator.cpp massindex.cpp massindexanchor.cpp \
	modification.cpp modificationdictionary.cpp peak.cpp peakintensity.cpp \
	peakintensityrm.cpp peaklcms.cpp peaktheomsms.cpp peaktheomsmsfactory.cpp \
	peaktheomsmsfactorybasic.cpp peptide.cpp peptidefactory.cpp peptidefromsequence.cpp \
	peptidemodifier.cpp peptidemsmsfactory.cpp peptidepmf.cpp peptidepmffactory.cpp \
	peptidespectrummatch.cpp peptidespectrummatchreader.cpp psmnistmspreader.cpp runlcmsms.cpp \
	runlcmsmsreader.cpp runlcmsmsreadermgf.cpp spectraalignment.cpp \
	spectraalignmentscoringmodel.cpp spectrum.cpp spectrumlcms.cpp spectrumlcmscollection.cpp \
	spectrumlcmsms.cpp spectrumlcmsmscollection.cpp spectrumlcmsmsmassindexanchor.cpp \
	spectrumpeakintensityutilities.cpp spectrumpeakref.cpp spectrumpeakrefdualptr.cpp \
	spectrumpeakrefsimple.cpp
	
libcaptainbol_utils_la_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_SERIALIZATION_LIB) $(PROTOBUT_LIBS)
